<!-- extends表明此页面继承自 base.html 文件 -->
{% extends "note/base.html" %}
{% load static %}
<!-- 写入 base.html 中定义的 title -->
{% block title %}
博客板块
{% endblock title %}
<!-- 写入 base.html 中定义的 content -->

{% block content %}
<div class="container">
    <br>
    <div>
        <h3>我的博客列表</h3>
        <a href="/note/add" class="btn btn-primary float-right mb-1">添加文章</a>
    </div>

    <table class="table table-striped">
        <thead>
            <th> 文章序号 </th>
            <th> 文章题目 </th>
            <th> 作者 </th>
            <th> 标签1 </th>
            <th> 标签2 </th>
            <th> 创建日期 </th>
            <th> 是否可见 </th>
            <th> 阅读量 </th>
            <th> 点赞数 </th>
            <th> 评论数 </th>
            <th> 操作 </th>
        </thead>
        <tbody>
        {% for note in notelist %}
        <tr>
            <td> {{forloop.counter}}</td>
            <td> <a href="single_note?auther={{note.auther.username}}&noteId={{note.id}}">{{note.title}}</a></td>
            <td> {{note.auther.username}} </td>
            <td> {{note.tag1}} </td>
            <td> {{note.tag2}} </td>
            <td> {{note.create_time}} </td>
            <td> {{note.is_show}} </td>
            <td> {{note.seen_num}} </td>
            <td> {{note.ok_num}} </td>
            <td> {{note.comment_num}} </td>
            <td> <a class="dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        ···
                    </a>
                    <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                        <a class="dropdown-item" href="/note/edit?auther={{note.auther.username}}&noteId={{note.id}}">编辑</a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item" href="/note/delete?auther={{note.auther.username}}&noteId={{note.id}}">删除</a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item" href="/note/single_note?auther={{note.auther.username}}&noteId={{note.id}}">浏览</a>
                    </div>
            </a></td>
        </tr>
        {% endfor %}
        </tbody>

    </table>

</div>
{% endblock content %}

